﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NETShop.ORM.SqlSugar.Repostitory
{
    public class Repostitory<T> : SqlSugarRepostitory<T>, IRepostitory<T> where T : class, new()
    {
        /// <summary>
        /// 返回的消息
        /// </summary>
        public ResponseMessage res = new ResponseMessage();

        public async Task<bool> DeleteTask(T deleteObj)
        {
            return await Context.Deleteable<T>().ExecuteCommandAsync() > 0 ? true : false;
        }

        public async Task<bool> InsertTask(T insertObj)
        {
            return await Context.Insertable<T>(insertObj).ExecuteCommandAsync() > 0 ? true : false;

        }

        public async Task<bool> UpdateTask(T insertObj)
        {
            return await Context.Updateable<T>().ExecuteCommandAsync() > 0 ? true : false;
        }
    }
}
